# 继承重写方法
class Person(object):

    #定义初始化构造函数
    def __init__(self, name, age):
        self.name = name
        self.age = age

    def info(self):
        print('获取个人信息，姓名：%s，年龄：%d' % (self.name, self.age))

class Student(Person):

    #定义初始化构造函数
    def __init__(self, name, age, stuNo):
        super(Student, self).__init__(name, age)    #调用父类的构造函数
        self.stuNo = stuNo

class Teacher(Person):

    #定义初始化构造函数
    def __init__(self, name, age, teach):
        super(Teacher, self).__init__(name, age)    #调用父类的构造函数
        self.teach = teach

    ## 重写父类的info示例方法
    def info(self):
        super(Teacher, self).info()     #调用父类的示例方法
        print('教师：%s, 负责科目：%s' % (self.name, self.teach))


# stu = Student('张三', 11, '1001')
tch = Teacher('战栗', 33, '会讲语文课')
# stu.info()
tch.info()
